<?php

namespace App;

use App\Model;

class Post extends Model
{
    //
//    protected $fillable = [
//        'title', 'content',
//    ];
//    protected $guarded = [];

        public function user(){
            return $this->belongsTo('\App\User');
        }
        public function comments(){

            return $this->hasMany('App\Comments');
        }
        public function zan($user_id){

            return $this->hasMany('App\Zan')->where('user_id',$user_id);
        }
    public function zans(){

        return $this->hasMany('App\Zan');
    }
}
